#ifndef __FLYCTL_NET_H__
#define __FLYCTL_NET_H__

#ifdef __cplusplus
extern "C"{
#endif // __cplusplus

#include <sys/socket.h>
#include <netinet/in.h> 
#include <net/if_arp.h> 
#include <arpa/inet.h> 


#define FLYCTL_SERVER_PORT 4647
#define MAXLINK 50

typedef enum{
	NET_STATUS_ERR = 2,
	NET_STATUS_DISCONNECT,
	NET_STATUS_DATA_ERR,
}NET_STATUS;

typedef struct{
	int socketFd;
	struct sockaddr_in sockAddr;
}SOCKET_ATTR;

typedef struct {
	SOCKET_ATTR servAttr;
	SOCKET_ATTR clientAttr;
}FLYCTL_NET_ATTR;



int flyctl_net_init(int port);
int flyctl_net_deinit();
int flyctl_net_accept();
int flyctl_net_get_wifi_conn_status();
int flyctl_net_get_wifi_conn_fd();
int flyctl_net_recv(unsigned char* buf,int len);
int flyctl_net_send(int fd,unsigned char* buf,int len);
int flyctl_net_sys_synctoapp(unsigned char* buf,int len);


#ifdef __cplusplus
}
#endif // __cplusplus


#endif
